﻿/* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 * '' Product        : Consilium
 * ''
 * '' Description    : Video Game
 * ''
 * '' Author         : Group #4
 * ''
 * '' Platforms      : This version is supported for Microsoft Windows
 * ''
 * ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
 */

/// <summary>
///   This namespace is for types of data and events that the Consilium
///   game components (model, view, and controller) use to communicate
///   with one another.
/// </summary>
namespace GameCommon
{
    /*********************************************************************
     * ENUMERATIONS
     * TODO: Add None resourcetype, teamcolor
     ********************************************************************/
    /// <summary>
    ///   Uniquely identifies a player in the game. All units and tiles
    ///   belong to one <c>TeamColor</c>.
    /// </summary>
    public enum TeamColor { Red, Blue, Green, Yellow, None };


    /// <summary>Species of units that can exist on the board.</summary>
    public enum UnitType { Spearman, Archer, Horseman, Miner };


    /// <summary>Species of terrain a tile can have.</summary>
    public enum TerrainType { Grass, Forest, Mountain };


    /// <summary>Species of resources a tile can have.</summary>
    public enum ResourceType { GoldMine, NeutralZone, BaseZone, None };



    /*********************************************************************
     * EVENTS
     * To subscribe to an event, use:
     *     model.EventName += new EventNameHandler(methodToPerformOnEvent);
     * where methodToPerformOnEvent has the same arguments as the event
     * delegate, and EventNameHandler is one of the delegates below.
     * 
     * TODO: Request newHealth attribute in UnitAttacks and unitRetaliates
     *********************************************************************/
    /// <summary>The game ends. A team has won.</summary>
    public delegate void GameWon(object source, TeamColor team);


    /// <summary>A team now has the exclusive right to move.</summary>
    public delegate void NewTurn(object source, TeamColor team);


    /// <summary>The unit on tile (x, y) disappears.</summary>
    public delegate void UnitKilled(object source, int x, int y);


    /// <summary>A unit of a type and team appears on tile (x, y).</summary>
    public delegate void UnitCreated(object source, int x, int y,
                                     UnitType type, TeamColor team);

    /// <summary>
    ///   The unit on tile (fromX, fromY) moves to tile (toX, toY).
    /// </summary>
    public delegate void UnitMoves(object source, int fromX, int fromY,
                                   int toX, int toY);


    /// <summary>
    ///   The unit on tile (fromX, fromY) attacks tile (toX, toY), causing
    ///   some `damage`.
    /// </summary>
    public delegate void UnitAttacks(object source, int fromX, int fromY,
                                     int toX, int toY, int damage);


    /// <summary>
    ///   The unit on tile (fromX, fromY) counter-attacks tile (toX, toY),
    ///   causing some `damage`.
    /// </summary>
    public delegate void UnitRetaliates(object source, int fromX, int fromY,
                                        int toX, int toY, int damage);


    /// <summary>A team takes notable tile (x, y).</summary>
    public delegate void ZoneCaptured(object source, int x, int y,
                                      TeamColor team);


    /// <summary>
    ///   A team takes a notable tile that changes their income.
    /// </summary>
    public delegate void MineAcquired(object source, int x, int y,
                                      TeamColor team, int newIncome);


    /// <summary>
    ///   A notable tile owned by team expires, changing their income
    ///   to newIncome.
    /// </summary>
    public delegate void MineDepleted(object source, int x, int y,
                                      TeamColor team, int newIncome);


    /// <summary>A team's available gold changes to a newAmount.</summary>
    public delegate void GoldChanges(object source, TeamColor team,
                                     int newAmount);
}